package com.example.autopia.view.ViewHolders.MyCars

import android.view.LayoutInflater
import android.view.animation.AnimationUtils
import androidx.recyclerview.widget.RecyclerView
import com.example.autopia.R
import com.example.autopia.databinding.ViewholderMyCarsAddBinding
import com.example.autopia.model.Item.Car
import com.example.autopia.view.Listeners.MyCarsListener

class AddMyCarsViewHolder  (private val binding: ViewholderMyCarsAddBinding, private val inflater: LayoutInflater) :
    RecyclerView.ViewHolder(binding.root) {

    fun bind(car: Car, listener: MyCarsListener){
        val animation = AnimationUtils.loadAnimation(inflater.context, R.anim.fade_in)
        binding.root.startAnimation(animation)
        binding.btAddCar.setOnClickListener {
            listener.onEditClicked(car,true)
        }
    }
}